<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .shadow{
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: #6ff;
            position: absolute;
            left: 0;
            top: 0;
        }
    </style>
</head>
<body>
    <div class="shadow"></div>
</body>
<script>
    var shadow = document.getElementsByClassName("shadow")[0];
    document.onmousemove = function(event){
        var event = event || window.event;
        var x = event.pageX - shadow.clientWidth/2;
        var y = event.pageY - shadow.clientHeight/2;
        shadow.style.left = x + "px";
        shadow.style.top = y + "px";

        
    }
</script>
</html>